package com.waves.search.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.FieldNameConstants;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author Eden
 * @date 2024/10/01 10:27
 **/
@Document(indexName = "task")
@Getter
@Setter
@FieldNameConstants
public class TaskEs {

    @Id
    @Field(type = FieldType.Keyword)
    private String id;

    /**
     * 标题
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String title;
    /**
     * 描述
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String description;
    /**
     * 内容
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String content;
    /**
     * 截止日期
     */
    @Field(type = FieldType.Long)
    private Long endTime;
    /**
     * 任务类型（0普通贴1任务贴2求助贴）
     */
    @Field(type = FieldType.Integer)
    private Integer type;
    /**
     * 赏金金额
     */
    @Field(type = FieldType.Double_Range)
    private Double bounty;

    /**
     * 帖子拥有人id
     */
    @Field(type = FieldType.Long)
    private Long userId;
    /**
     * 赏金数量
     */
    @Field(type = FieldType.Long)
    private Long bountyNum;

    /**
     * 点赞数
     */
    @Field(type = FieldType.Long)
    private Long likedNum;

    /**
     * 收藏数
     */
    @Field(type = FieldType.Long)
    private Long collectedNum;


    private Long createdBy;

    private Long createdTime;

    private String createdName;

    private Long updatedBy;

    private Long updatedTime;

    private String updatedName;

    private Integer delFlag;
}
